package com.ruoyi.factory.bom.domain;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName BomTreeSelect
 * @Description: TODO
 * @Author LiuJiaji
 * @Date 2022/11/26 12:32
 **/
public class BomTreeSelect implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private String id;

    /** 节点名称 */
    private String label;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<BomTreeSelect> children;

    public BomTreeSelect()
    {

    }

    public BomTreeSelect(BomCost bomcost)
    {
        this.id = bomcost.getPartId();
        this.label = bomcost.getChinaName();
        this.children = bomcost.getChildren().stream().map(BomTreeSelect::new).collect(Collectors.toList());
    }



//    public TreeSelect(SysMenu menu)
//    {
//        this.id = menu.getMenuId();
//        this.label = menu.getMenuName();
//        this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
//    }

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getLabel()
    {
        return label;
    }

    public void setLabel(String label)
    {
        this.label = label;
    }

    public List<BomTreeSelect> getChildren()
    {
        return children;
    }

    public void setChildren(List<BomTreeSelect> children)
    {
        this.children = children;
    }
}
